package com.xinzhidi.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * 读取代码生成相关配置
 *
 * @author ruoyi
 */
@Component
@ConfigurationProperties(prefix = "aliyun")
@PropertySource(value = {"classpath:aliyun.yml"})
public class AliyunConfig {
    /**
     * 作者
     */
    public static String endpoint;

    /**
     * 生成包路径
     */
    public static String accessId;

    /**
     * 自动去除表前缀，默认是false
     */
    public static String accessKey;

    /**
     * 表前缀(类名不会包含表前缀)
     */
    public static String bucket;

    public static String dir;

    public static String getEndpoint() {
        return endpoint;
    }

    @Value("${endpoint}")
    public void setEndpoint(String endpoint) {
        AliyunConfig.endpoint = endpoint;
    }

    public static String getAccessId() {
        return accessId;
    }

    @Value("${accessId}")
    public void setAccessId(String accessId) {
        AliyunConfig.accessId = accessId;
    }

    public static String getAccessKey() {
        return accessKey;
    }

    @Value("${accessKey}")
    public void setAccessKey(String accessKey) {
        AliyunConfig.accessKey = accessKey;
    }

    public static String getBucket() {
        return bucket;
    }

    @Value("${bucket}")
    public void setBucket(String bucket) {
        AliyunConfig.bucket = bucket;
    }

    public static String getDir() {
        return dir;
    }

    @Value("${dir}")
    public void setDir(String dir) {
        AliyunConfig.dir = dir;
    }
}
